* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 28px;
}

main {
    padding: 30px;
}

.card {
    margin-bottom: 30px;
}

.card h2 {
    color: #333;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* 表单 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-item {
    display: flex;
    flex-direction: column;
}

.form-item.full {
    grid-column: 1 / -1;
}

.form-item label {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
}

.required {
    color: #e74c3c;
}

.form-item input,
.form-item select,
.form-item textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-item input:focus,
.form-item select:focus,
.form-item textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* 材料项 */
.material-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.material-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    cursor: pointer;
}

.material-header:hover {
    background: #e9ecef;
}

.material-number {
    width: 28px;
    height: 28px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    margin-right: 12px;
}

.material-title {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.material-header.active .toggle-icon {
    transform: rotate(-180deg);
}

.material-content {
    padding: 20px;
    display: none;
}

.material-content.show {
    display: block;
}

.material-desc {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    margin-bottom: 15px;
}

/* 文件上传 */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-input {
    display: none;
}

.file-preview {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.file-item {
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px;
}

.file-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.pdf-icon {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 40px;
}

.file-name {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}

/* 按钮 */
.actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    min-width: 400px;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

#progressFill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
}

#progressText {
    color: #666;
    font-size: 14px;
}

/* 提示消息 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: white;
    z-index: 10000;
    animation: slideIn 0.3s;
}

.message.success { background: #27ae60; }
.message.error { background: #e74c3c; }
.message.info { background: #3498db; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 字体上传区域 */
.font-upload-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.font-hint {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    padding: 12px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
}

.font-hint strong {
    color: #333;
}

.font-upload-section .form-item label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.font-upload-section input[type="file"] {
    border: 2px dashed #667eea;
    background: white;
    cursor: pointer;
}

.font-upload-section input[type="file"]:hover {
    border-color: #764ba2;
    background: #f0f4ff;
}

.font-status {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 4px;
}

.font-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.font-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 响应式 */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
    
    .font-hint {
        font-size: 13px;
    }
}